package com.qqtech.qquan.homemaking.service;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.qqtech.core.frame.service.BaseService;
import com.qqtech.qquan.homemaking.model.HomemakingBase;
import com.qqtech.qquan.homemaking.model.HomemakingBaseVo;
import com.qqtech.qquan.homemaking.model.HomemakingType;
import com.qqtech.qquan.homemaking.model.HomemakingTypeVo;

public interface HomemakingTypeService extends BaseService<HomemakingType> {
	public HomemakingTypeVo getByName(java.lang.String name) ;
	
	/**
	 * 获取一级类别
	 * @param status 状态,当status==null时,返回所有状态的
	 * @return
	 */
	public List<HomemakingTypeVo> findParent(Integer status);
	
	/**
	 * 获取二级类别
	 * @param parentId 一级类别id
	 * @param status 状态,当status==null时,返回所有状态的
	 * @return
	 */
	public List<HomemakingTypeVo> findChildren(Integer parentId,Integer status);
	
	/**
	 * 后台查询列表
	 * @param query
	 * @param pageable
	 * @return
	 */
	public Page<HomemakingTypeVo> queryPageListAdmin(HomemakingType query, Pageable pageable);
	
	/**
	 * 从缓存获取有效的子类别，当parentId=0时获取父级
	 * @param parentId
	 * @return
	 */
	public List<HomemakingTypeVo> findChildrenByCache(Integer parentId);
}